package cn.hxzy.mapper;

import cn.hxzy.domain.User;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StudentListMapper {


    @Select("SELECT * FROM `sys_user` WHERE user_id=#{userId} AND user_type=2")
    User selectUserList(Integer userId);

    /**
     * 根据班级Id查询学生
     * @param classId
     * @return
     */
    @Select("SELECT user_id FROM `sys_user_class` WHERE class_id=#{classId}")
    List<Integer> getStudentIdListByClassId(Integer classId);

    /**
     * 根据专业Id查询学生
     * @param directionId
     * @return
     */
    @Select("SELECT user_id FROM `user_info` WHERE direction_id=#{directionId}")
    List<Integer> getStudentIdListBydirectionId(Integer directionId);

    /**
     * 根据入学年份查询学生
     * @param addTime
     * @return
     */
    @Select("SELECT user_id FROM `user_info` WHERE add_time=#{addTime}")
    List<Integer> getStudentIdListByAddTime(Integer addTime);

}
